#ifndef _KPAR2_CUSTOMEVENTS_H_
#define _KPAR2_CUSTOMEVENTS_H_

#include <qapplication.h>
#include <qevent.h>


class ParHeaders;

typedef enum _Operation{
    noop = 0,
    load = 1,
    verify = 2,
    repair = 3
} Operation;

typedef enum _FinishedStatus{
    info = 0,
    ok = 1,
    warning = 2,
    error = 3
} FinishedStatus;

typedef enum _TypeProgress{
    file = 0,
    total = 1,

} TypeProgress;

class HeaderInfo : public QEvent
{
    public:
        HeaderInfo( ParHeaders *headers ) : QEvent( QEvent::User ), _headers( headers ){}
        ~HeaderInfo(){}
        ParHeaders *headers(){ return _headers; }
    private:
        ParHeaders *_headers;
};



class UpdateProgress : public QEvent
{
    public:
    UpdateProgress( int progress , const TypeProgress &type ) : QEvent( QEvent::Type (QEvent::User + 1 )), p( progress ), m_typ( type ){}
        ~UpdateProgress(){}
        int progress() const{ return p; }
        TypeProgress type() const{ return m_typ; }
    private:
        int p;
        TypeProgress m_typ;
};

class UpdateListe : public QEvent
{
    public:
    UpdateListe( QString str, FinishedStatus stat ) : QEvent( QEvent::Type(QEvent::User + 2 )), str( str ), stat( stat ){}
        ~UpdateListe(){}
        QString text() const{ return str; }
        FinishedStatus status() const{ return stat; }
    private:
        QString str;
        FinishedStatus stat;
};

class UpdateStatusBar : public QEvent
{
    public:
    UpdateStatusBar( QString str ) : QEvent( QEvent::Type(QEvent::User + 3) ), str( str ){}
    ~UpdateStatusBar(){}
    QString statusbar() const{ return str; }
    private:
        QString str;
};

#endif // _KPAR2_CUSTOMEVENTS_H_
